package com.ruoyi.info.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.info.mapper.CmsQbMapper;
import com.ruoyi.info.domain.CmsQb;
import com.ruoyi.info.service.ICmsQbService;
import com.ruoyi.common.core.text.Convert;

/**
 * 威胁情报-搜索记录Service业务层处理
 * 
 * @author xwj
 * @date 2023-08-23
 */
@Service
public class CmsQbServiceImpl implements ICmsQbService 
{
    @Autowired
    private CmsQbMapper cmsQbMapper;

    /**
     * 查询威胁情报-搜索记录
     * 
     * @param id 威胁情报-搜索记录主键
     * @return 威胁情报-搜索记录
     */
    @Override
    public CmsQb selectCmsQbById(Long id)
    {
        return cmsQbMapper.selectCmsQbById(id);
    }

    /**
     * 查询威胁情报-搜索记录列表
     * 
     * @param cmsQb 威胁情报-搜索记录
     * @return 威胁情报-搜索记录
     */
    @Override
    public List<CmsQb> selectCmsQbList(CmsQb cmsQb)
    {
        return cmsQbMapper.selectCmsQbList(cmsQb);
    }

    /**
     * 新增威胁情报-搜索记录
     * 
     * @param cmsQb 威胁情报-搜索记录
     * @return 结果
     */
    @Override
    public int insertCmsQb(CmsQb cmsQb)
    {
        cmsQb.setCreateTime(DateUtils.getNowDate());
        return cmsQbMapper.insertCmsQb(cmsQb);
    }

    /**
     * 修改威胁情报-搜索记录
     * 
     * @param cmsQb 威胁情报-搜索记录
     * @return 结果
     */
    @Override
    public int updateCmsQb(CmsQb cmsQb)
    {
        cmsQb.setUpdateTime(DateUtils.getNowDate());
        return cmsQbMapper.updateCmsQb(cmsQb);
    }

    /**
     * 批量删除威胁情报-搜索记录
     * 
     * @param ids 需要删除的威胁情报-搜索记录主键
     * @return 结果
     */
    @Override
    public int deleteCmsQbByIds(String ids)
    {
        return cmsQbMapper.deleteCmsQbByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除威胁情报-搜索记录信息
     * 
     * @param id 威胁情报-搜索记录主键
     * @return 结果
     */
    @Override
    public int deleteCmsQbById(Long id)
    {
        return cmsQbMapper.deleteCmsQbById(id);
    }
}
